package com.zhangli.common_code.common;


import com.zhangli.common_code.exception.ErrorCode;

public class ResultUtils {
    public static <T> BaseResponse<T> success(T data) {
        return new BaseResponse<>(0,null,"ok");
    }
    public static BaseResponse<?> error(ErrorCode errorCode) {
        return new BaseResponse<>(errorCode);
    }
    public static BaseResponse<?> error(ErrorCode errorCode, String msg) {
        return new BaseResponse<>(errorCode.getCode(),null,msg);
    }
    public static BaseResponse<?> error(int code,String msg) {
        return new BaseResponse<>(code,null,msg);
    }
}
